//获取一键检测所有数据  数据库模块
import {
  getTEDBackup,
  getTEDASM,
  getTEDTableSpace,
  getTEDRecyclebin,
  getTEDInvalidObject,
  getTEDDBAUser,
  getTEDDBTime,
  getTEDWaitClass,
  getTEDLock,
  getTEDInformation,
  getTEDLatch,
  getTEDDiary,
  getTEDDBInfo,
  getTEDDBServerInfo,
  getTEDDBMEMORY,
  getTEDDBSGA,
  getTEDDBPGA,
  getTEDDBSHAREDPOOL,
  getTEDDBDBCACHE,
} from "@/api/index.js";

export function getDataBaseAllData(RequestData, logRequestData,bkjRequestData) {
  // 1.检查备份情况
  const TEDBackup = new Promise((resolve, reject) => {
    getTEDBackup(RequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  });
  // 2.检查ASM磁盘组使用情况
  const TEDASM = new Promise((resolve, reject) => {
    getTEDASM(RequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  });
  // 3.检查表空间
  const TEDTableSpace = new Promise((resolve, reject) => {
    getTEDTableSpace(bkjRequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  });
  // 检查回收站对象
  const TEDRecyclebin = new Promise((resolve, reject) => {
    getTEDRecyclebin(RequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  });
  // 检查数据库无效对象
  const TEDInvalidObject = new Promise((resolve, reject) => {
    getTEDInvalidObject(RequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  });
  // 检查具备dba权限的特殊用户
  const TEDDBAUser = new Promise((resolve, reject) => {
    getTEDDBAUser(RequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  });
  // 检查dbtime
  const TEDDBTime = new Promise((resolve, reject) => {
    getTEDDBTime(RequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  });
  // 检查等待事件
  const TEDWaitClass = new Promise((resolve, reject) => {
    getTEDWaitClass(RequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  });
  // 检查长时间事务锁
  const TEDLock = new Promise((resolve, reject) => {
    getTEDLock(RequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  });
  // 检查统计信息收集情况
  const TEDInformation = new Promise((resolve, reject) => {
    getTEDInformation(RequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  });
  // 检查latch
  const TEDLatch = new Promise((resolve, reject) => {
    getTEDLatch(RequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  });

  //日志
  const TEDDiary = new Promise((resolve, reject) => {
    getTEDDiary(logRequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  })

  //数据库基本信息
  const TEDDBInfo = new Promise((resolve, reject) => {
    getTEDDBInfo(RequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  })


  //服务器基本信息
  const TEDDBServerInfo = new Promise((resolve, reject) => {
    getTEDDBServerInfo(RequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  })

  //内存建议 MEMORY
  const TEDDBMEMORY = new Promise((resolve, reject) => {
    getTEDDBMEMORY(RequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  })

  //内存建议  SGA
  const TEDDBSGA = new Promise((resolve, reject) => {
    getTEDDBSGA(RequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  })

  //内存建议 PGA
  const TEDDBPGA = new Promise((resolve, reject) => {
    getTEDDBPGA(RequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  })

  //内存建议  SHAREDPOOL
  const TEDDBSHAREDPOOL = new Promise((resolve, reject) => {
    getTEDDBSHAREDPOOL(RequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  })

  //内存建议 DBCACHE
  const TEDDBDBCACHE = new Promise((resolve, reject) => {
    getTEDDBDBCACHE(RequestData)
      .then((_) => resolve(_))
      .catch((_) => reject(_));
  })


  return Promise.all([
    TEDBackup,
    TEDASM,
    TEDTableSpace,
    TEDRecyclebin,
    TEDInvalidObject,
    TEDDBAUser,
    TEDDBTime,
    TEDWaitClass,
    TEDLock,
    TEDInformation,
    TEDLatch,
    TEDDiary,
    TEDDBInfo,
    TEDDBServerInfo,
    TEDDBMEMORY,
    TEDDBSGA,
    TEDDBPGA,
    TEDDBSHAREDPOOL,
    TEDDBDBCACHE,
  ]);
}